package variabilitysmelldetection.plugin.models;

import java.util.ArrayList;
import java.util.List;

public class ItemModel {
	private String name;
	private double value;
	private ItemModel parent;
	private List<ItemModel> children;
	
	public ItemModel(String name, ItemModel parent) {
		this.name     = name;
		this.parent   = parent;
		this.children = new ArrayList<ItemModel>();
		this.value    = 0d;
	}

	public String getName(){
		return name;
	}
	
	public ItemModel getParent(){
		return parent;
	}
	
	public void setParent(ItemModel itemModel){
		parent = itemModel;
	}
	
	public List<ItemModel> getChildren(){
		return children;
	}
	
	public void addChild(ItemModel itemModel){
		children.add(itemModel);
	}
	
	public double getValue(){
		return value;
	}
	
	public void setValue(double value){
		this.value = value;
	}
	
	public String toString() {
		return name;
	}
}
